//
//  DiscoverTableViewCell.m
//  TravelFollowYourHeart
//
//  Created by ENERGY on 2017/12/18.
//  Copyright © 2017年 Lwx. All rights reserved.
//

#import "DiscoverTableViewCell.h"
#define collectionBtnW 100
#define moneyLabelW 50
#define borderW 20

@interface DiscoverTableViewCell()
@property (nonatomic, strong)UIImageView * contentImage;
@property (nonatomic, strong)UILabel * totalLabel;
@property (nonatomic, strong)UIView * detailView;
@property (nonatomic, strong)UIButton * testBtn;
@property (nonatomic, strong)UILabel * titleLabel;
@property (nonatomic, strong)UILabel * moneyLabel;
@end

@implementation DiscoverTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = getColor(@"e5e5e5");
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.contentImage];
        [self.contentView addSubview:self.totalLabel];
        [self.contentView addSubview:self.detailView];
        
    }return self;
}

- (UILabel *)totalLabel{
    if (!_totalLabel) {
        _totalLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - collectionBtnW - 10, self.detailView.top - 10 - 20, collectionBtnW, 20)];
        _totalLabel.text = @"168人已报名";
        _totalLabel.backgroundColor = [UIColor clearColor];
        _totalLabel.font = [UIFont systemFontOfSize:14.0];
        _totalLabel.textAlignment = NSTextAlignmentLeft;
    }return _totalLabel;
}

- (UIImageView *)contentImage{
    if (!_contentImage) {
        _contentImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 181)];
    }return _contentImage;
}

- (UIView *)detailView{
    if (!_detailView) {
        _detailView = [[UIView alloc] initWithFrame:CGRectMake(0, self.contentImage.bottom, SCREEN_WIDTH, 39)];
        _detailView.backgroundColor = [UIColor greenColor];
        
    }return _detailView;
}

- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.contentImage.bottom, SCREEN_WIDTH - moneyLabelW - borderW, self.detailView.height)];
        
    }return _titleLabel;
}

- (UILabel *)moneyLabel{
    if (!_moneyLabel) {
        
    }return _moneyLabel;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
